RDKB-64502: [RDKB][TELEMETRY2_0] Multi‑profile config using method = subscribe, logs null & empty values - #406
Open
AravindanNC wants to merge 3 commits into
Open
RDKB-64502: [RDKB][TELEMETRY2_0] Multi‑profile config using method = subscribe, logs null & empty values#406AravindanNC wants to merge 3 commits into
AravindanNC wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Telemetry 2.0 report generation to avoid emitting event marker entries when the marker value is empty/placeholder and the marker is configured not to report empty values (notably for multi-profile method=subscribe scenarios).
Changes:
- Skip encoding an event marker into JSON when
reportEmptyParamisfalseand the marker value qualifies as empty viacheckForEmptyString(). - Free and null out the skipped marker’s
u.markerValueto avoid carrying empty values forward.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
source/reportgen/reportgen.c:1572
- This change introduces new behavior (skipping empty/"NULL" event marker values when reportEmptyParam is false), but existing encodeEventMarkersInJSON tests don’t assert that empty/"NULL"/whitespace-only values are skipped or that leading-whitespace non-empty values are preserved. Adding a focused unit test would help prevent regressions for subscribe-based multi-profile configs.
if(!eventMarker->reportEmptyParam && checkForEmptyString(eventMarker->u.markerValue))
{
T2Debug("Skipping empty/\"NULL\" marker value for : %s\n", eventMarker->markerName);
source/reportgen/reportgen.c:1576
- The empty/"NULL" check runs on the raw markerValue before trimming/normalization. Because checkForEmptyString() treats any leading space as empty, a non-empty value like " 1.23" (or values with leading whitespace) will now be skipped even though it should be reported (especially when trimParam is enabled). Consider ignoring leading whitespace for the emptiness check so only truly empty/whitespace-only/"NULL" values are skipped.
if(eventMarker->u.markerValue != NULL)
{
if(!eventMarker->reportEmptyParam && checkForEmptyString(eventMarker->u.markerValue))
{
T2Debug("Skipping empty/\"NULL\" marker value for : %s\n", eventMarker->markerName);
free(eventMarker->u.markerValue);
eventMarker->u.markerValue = NULL;
break;
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
source/reportgen/reportgen.c:1572
- This change introduces new behavior (skipping empty/"NULL" event marker values when reportEmptyParam is false) but there is no unit test asserting that cJSON object creation/add-to-array is skipped for markerValue "" or "NULL".
if(!eventMarker->reportEmptyParam && checkForEmptyString(eventMarker->u.markerValue))
{
T2Debug("Skipping empty/\"NULL\" marker value for : %s\n", eventMarker->markerName);
source/reportgen/reportgen.c:1574
- The empty/"NULL" check runs before trimLeadingAndTrailingws(), but checkForEmptyString() treats any string starting with a space as empty. With trimParam enabled, values like " 1.23" will be skipped instead of being trimmed and reported.
if(!eventMarker->reportEmptyParam && checkForEmptyString(eventMarker->u.markerValue))
{
T2Debug("Skipping empty/\"NULL\" marker value for : %s\n", eventMarker->markerName);
free(eventMarker->u.markerValue);
eventMarker->u.markerValue = NULL;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for change: Check for NULL and empty values before adding to report
Test Procedure: Build RDKE image
Signed-off-by: nc.aravindan@gmail.com